-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add stats/incr/nanmmaape package
#9338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Implement moving mean arctangent absolute percentage error
with NaN handling. Add thin wrapper around mmaape that
ignores NaN values in either argument. Include comprehensive
test suite (52 tests, all passing), TypeScript definitions
and type tests, benchmarks for performance testing, examples
demonstrating NaN handling, and complete documentation in
README.
Closes RFC for nanmmaape implementation.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: passed
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: passed
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
/stdlib merge |
|
/stdlib update-copyright-years |
Planeshifter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good overall.
| { | ||
| "name": "@stdlib/stats/incr/nanmmaape", | ||
| "version": "0.0.0", | ||
| "description": "Compute a moving arctangent mean absolute percentage error (MAAPE) incrementally, ignoring NaN values.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description has the words in the wrong order - should be "mean arctangent absolute percentage error" (MAAPE stands for Mean Arctangent Absolute Percentage Error), not "arctangent mean absolute percentage error".
| "description": "Compute a moving arctangent mean absolute percentage error (MAAPE) incrementally, ignoring NaN values.", | |
| "description": "Compute a moving mean arctangent absolute percentage error (MAAPE) incrementally, ignoring NaN values.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package is missing a docs/repl.txt file. All stdlib packages need this file for REPL documentation. You can reference @stdlib/stats/incr/mmaape/docs/repl.txt as a template and update it to mention the NaN-ignoring behavior.
@stdlib/stats/incr/nanmmaape packagestats/incr/nanmmaape package
Add
@stdlib/stats/incr/nanmmaape- Moving MAAPE with NaN handlingImplement moving mean arctangent absolute percentage error with NaN handling. Add thin wrapper around
mmaapethat ignores NaN values in either the forecast or actual argument. Include comprehensive test suite (52 tests, all passing), TypeScript definitions and type tests, benchmarks for performance testing, examples demonstrating NaN handling, and complete documentation in README.Closes RFC for
nanmmaapeimplementation.type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
Resolves #5562
Description
This pull request:
@stdlib/stats/incr/nanmmaapeto compute a moving mean arctangent absolute percentage error (MAAPE) incrementally, ignoring NaN values@stdlib/stats/incr/mmaapethat skips NaN values in either the forecast (f) or actual (a) parametersRelated Issues
This pull request has the following related issues:
Questions
No.
Other
Implementation Notes:
@stdlib/stats/incr/nansumwrapping@stdlib/stats/incr/summmaapeaccumulator is not called, so the window state remains unchangedTest Results:
✅ Total: 52 tests
✅ Passing: 52
✅ Failing: 0
✅ Duration: 43-55ms
Benchmark Results:
✅ Constructor: ~21M ops/sec
✅ Accumulator: ~10M ops/sec
✅ Accumulator with NaN: ~7.5M ops/sec
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored with significant AI assistance (GitHub Copilot). The AI helped with:
mmaape,nansum,sum) to understand implementation patternsnansumpatternmmaapetests with NaN-specific scenariosAll code follows stdlib conventions and passes all static analysis checks. The implementation was iteratively tested and refined to ensure correct behavior and comprehensive test coverage.
@stdlib-js/reviewers